=link_to("计算工资", "#", class: 'button', id: "salary")
#chooser{class: 'modal2 fade',tabindex: -1, role: 'dialog',"aria-labelledby": 'myModalLabel'}
  = semantic_form_for([:admin, Payroll.new],url: '/admin/payrolls/recalculate', builder: ActiveAdmin::FormBuilder) do |f|
    = f.inputs '选择' do
      = f.input :company_id,as: :select,input_html: {multiple: "multiple"}, collection: Company.all.pluck(:name,:id).insert(0,['全部',"-1"]), label: '集团',include_blank: false,include_hidden: false
      = f.input :coach_id,as: :select,input_html: {multiple: "multiple"},collection: Coach.all.pluck(:name,:id).insert(0,['全部',"-1"]), include_blank: false,include_hidden: false
      = f.input :class_start_time,as: :datepicker, label: '开始日期'
      = f.input :class_end_time,as: :datepicker, label: '结束日期'
    %br
    = f.submit("确定")
:javascript
  $(function(){
    var chooser =  $("#chooser");
    $("#salary").on("click",function(e){
      e.preventDefault();
      chooser.modal('view',{
        speed : 200,
        easing : 'easeInOutElastic',
        animation : 'top height width',
        position: '10% auto',
        overlayClose : true,
        on : 'click',
        overlayColor : '#ccc',
        overlayOpacity : .9,
        close : '.close'
      });
    })
  })

